const mysql = require('mysql');

const pool = mysql.createPool({
  host: 'localhost',
  port: 3306,
  user: 'root',
  password: '3052959wyp.',
  database: 'blogs'
});

const exec = (sql) => {
  return new Promise((resolve, reject) => {
    pool.query('select * from  users', (err, data) => {
      if (err) reject(err)
      console.log('data:', data)
      resolve(data)
    })
  })
}

exec()
